

#ifndef ACTIONMANAGER_H__
#define ACTIONMANAGER_H__


#include <QAction>
#include <QToolBar>
#include <QMainWindow>
#include "RibbonStyleAPI.hpp"

#include "ActionPlane.hpp"

NAMESPACE_BEGIN(NSActionManager)


typedef QMap<int, NSActionPlane::ActionPlane*> PlaneMap;
typedef NSActionPlane::ActionPlane* Plane;


class RIBBONSTYLEAPI ActionManager : public QObject {
    Q_OBJECT
    SIGNALDEC(ActionManager, QObject)

public:
    /*Get*/
    PlaneMap getPlanes() { return planes; }
    NSActionPlane::ActionPlane* getPlane(int index) { return planes.value(index); }
    QToolButton* getPlaneButton(int area, int index) { return planes.value(area)->getButton(index); }
    /*Exchange*/
    void addPlane(int index, NSActionPlane::ActionPlane* plane);
    void removePlane(int index);

protected:
    void Initialize();
    void Finalize();

protected:
    QMap<int, NSActionPlane::ActionPlane*> planes;

};

NAMESPACE_END

#endif // !_ACTIONMANAGER_H__
